package com.jams.goodox.adapter.viewHolder;

import android.content.Context;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;

import com.bigkoo.convenientbanner.holder.Holder;
import com.facebook.drawee.view.SimpleDraweeView;
import com.jams.goodox.R;
import com.jams.goodox.entity.FocusBean;
import com.jams.goodox.utils.StringUtils;

/**
 * Created by jams on 2016/5/5.
 * ***
 * Tel: ***
 */
public class BannerViewHolder implements Holder<FocusBean> {
    private SimpleDraweeView imageView;

    @Override
    public View createView(Context context) {
        View view = LayoutInflater.from(context).inflate(R.layout.simpledrawee_item, null);
        imageView = (SimpleDraweeView) view.findViewById(R.id.sdv);
        return view;
    }

    @Override
    public void UpdateUI(Context context, int position, FocusBean data) {
        if (data != null) {
            if(!"http://app.tongmenhui.net/resource/upload/2017/1031/43ca6d3593e2dc3581fd4c15873cbffb.png".contains(data.getUrl()))
            imageView.setImageURI(Uri.parse(StringUtils.newString(data.getUrl())));
        }
    }
}
